<?php

namespace app\admin\command;

use app\admin\model\EarlyWarningRule;
use app\admin\model\Street;
use app\admin\service\EarlyWarningService;
use app\admin\service\OperationService;
use think\console\Command;
use think\console\Input;
use think\console\Output;

class EarlyWarning extends Command
{
    protected function configure()
    {
        $this->setName('early-warning')
            ->setDescription('预警规则计算');
    }

    public function exec() {
        $input = new Input;
        $output = new Output;
        $this->execute($input, $output);
    }

    /**
     * 日环比：今天零点，算昨天跟前天的
     * 周环比：以上周六-本周五为一周，本周六凌晨，出本周跟上周的比对
     * 月环比：每月月末最后一天23:59:59，出本月跟上月的比对
     *
     * @param Input  $input
     * @param Output $output
     *
     * @return void
     */
    protected function execute(Input $input, Output $output)
    {
        (new EarlyWarningService)->task();
    }

}

